package com.attain.mapper;

import com.attain.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Insert("INSERT INTO user (username, password, name, register_time) VALUES (#{username}, #{password}, #{name}, #{registerTime})")
    void add(User user);

    @Select("SELECT * FROM user WHERE username = #{username}")
    User findByUsername(String username);
}